package com.shiliao.app.activity.index.presenter;

import com.shiliao.app.activity.index.service.IDailyKnowledgeService;
import com.shiliao.app.activity.index.service.impl.DailyKnowledgeImpl;
import com.shiliao.app.activity.index.view.DailyKnowledgeView;
import com.shiliao.app.utils.YMServerUtil;
import com.yimei.framework.mvp.presenter.IBasePresenter;
import com.yimei.framework.network.ICallBack;
import com.yimei.framework.util.LogUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by yinzhiqiang on 2017/9/7.
 */

public class DailyKnowledgePresenter extends IBasePresenter<IDailyKnowledgeService> {
    private DailyKnowledgeView dailyKnowledgeView;
    private IDailyKnowledgeService dailyKnowledgeService;

    public DailyKnowledgePresenter(DailyKnowledgeView dailyKnowledgeView) {
        this.dailyKnowledgeView = dailyKnowledgeView;
        dailyKnowledgeService = new DailyKnowledgeImpl();
        setService(dailyKnowledgeService);
    }

    @Override
    public void loadData() {
        super.loadData();
        Map param = new HashMap();
        dailyKnowledgeService.loadData(YMServerUtil.ACTION_DAILY_KNOWLEDGE, param, new ICallBack() {
            @Override
            public void onSuccess(int statusCode, Object result) {
                LogUtil.e("yzq", result.toString());
                LogUtil.e(".............");
            }

            @Override
            public void onFail(int statusCode, Object result) {
                LogUtil.e(".............");
            }
        });
    }
}
